package study.ttl.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import study.ttl.entity.Comment;

import java.util.List;

@Mapper
public interface CommentMapper {

    // 插入日志
    void insert(Comment comment);

    // 根据id删除
    @Delete("delete from comment where id = #{id}")
    void deleteById(Integer id);

    // 根据id修改
    void updateById(Comment comment);

    // 根据id查询
    @Select("select * from comment where id = #{id}")
    Comment selectById(Integer id);

    // 根据条件查询所有
    List<Comment> selectAll(Comment comment);

    // 批量删除
    void deleteBatch(List<Integer> ids);
}
